import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import formateDate from './config/date'
//sssss
Vue.use(formateDate);

Vue.config.productionTip = false
// 公共样式
import './assets/css/common.scss';

// elementUI组件//
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);
Vue.prototype.$ELEMENT = { size: 'mini' };
ElementUI.Dialog.props.closeOnClickModal.default = false;
// 接口方法
import axios from 'axios';
Vue.prototype.axios = axios;
axios.defaults.baseURL = 'http://127.0.0.1:8888/wh';

// 事件总线
let bus = new Vue();
Vue.prototype.bus = bus;

// 全局过滤器
import filters from './utils/filters';
Object.keys(filters).forEach(k => Vue.filter(k, filters[k]));

//------------------- 一、请求拦截器
axios.interceptors.request.use(function (config) {
  return config;
}, function (error) {
  // 对请求错误做些什么
  return Promise.reject(error);
});

//----------------- 二、响应拦截器
axios.interceptors.response.use(function (response) {
  return response.data;
}, function (error) {
  // 对响应错误做点什么
  console.log('拦截器报错');
  return Promise.reject(error);
});

sessionStorage.setItem('userId', '4102002109');
sessionStorage.setItem('jh', '019580');
sessionStorage.setItem('xm', '周子健');
sessionStorage.setItem('photo', '');
sessionStorage.setItem('lxdh', '18337868756');
sessionStorage.setItem('gmsfhm', '410223198412021050');
sessionStorage.setItem('jwsdm', '410223690200');
sessionStorage.setItem('jwsmc', '兰考县公安局坝头派出所南北庄警务室');
sessionStorage.setItem('dwdm', '410223690000');
sessionStorage.setItem('dwmc', '兰考县公安局坝头派出所');
sessionStorage.setItem('gwid', '5102022106');

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

